const router = require("koa-router")();
const MembersModel = require("../../models/members")

router.get('/m1/dolike',async ctx=> {
    
    // var res = ctx.req.body;
    var {id,like} = ctx.query;
    // console.log(ctx.query)
    if(like == "true"){
        await MembersModel.updateOne({_id:id},{like:Boolean(false)})
    }else{
        await MembersModel.updateOne({_id:id},{like:Boolean(true)})
    }
    ctx.redirect("/m1")
}) 
module.exports = router;